
int ledpins[]={10,11,12};
int inpin=0;//ao
int val;
float temp;
int blinkrate;
void setup()
{
for(int index=0;index<3;index++)
	{
	pinmode(ledpins[index],output);
	}

}
void loop()
{
val=analogread(inpin);
temp=(val/1024.0)*5*1000/10;
blinkrate=(100-temp)*2;//温度越高该值越小
int time;
for(int index=0;index<3;index++)
	{
	pinmode(ledpins[index],low);
	}
if(temp<=30)
	{time=blink(ledpins[0]);
	digitalwrite(ledpins[0],high)

	}
else if(temp>30&&temp<=60)
	{time=blink(ledpins[1]);
		digitalwrite(ledpins[1],high)

	}
else
	{time=blink(ledpins[2]);
	digitalwrite(ledpins[2],high)
	}
delay(1000);
}
int blink(int ledpin)
{
for(int counter=0;contour<3;counter++)
	{
	digitalwrite(ledpin,high);
	delay(blinkrate);
		digitalwrite(ledpin,low);
			delay(blinkrate);
	
	}
	return blinkrate*3*2+1000;
	}
